package com.psy.counseling.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 *
 * @author 梁学儒
 * @since 2022-05-31
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String username;

    private String password;

    @Email(message = "请填写正确的邮箱！")
    private String email;

    private String registerTime;

    private String loginTime;

    @NotBlank(message = "真实姓名不能为空！")
    private String realName;

    @NotBlank(message = "性别不能为空！")
    private String sex;

    @NotBlank(message = "年龄不能为空！")
    private String age;

    /**
     * 院系
     */
    private String faculty;

    @Pattern(regexp = "^[1](([3][0-9])|([4][5-9])|([5][0-3,5-9])|([6][5,6])|([7][0-8])|([8][0-9])|([9][1,8,9]))[0-9]{8}$", message = "手机号码无效")
    private String telephone;

    private String info;

    private String userPhoto;

    // 激活码
    @TableField("active_code")
    private String activeCode;

    private Integer status;

    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;


}
